Tables [dbo].[OpportunityMain]
Properties
PropertyValue
Created10:31:29 AM Tuesday, March 02, 2010
Last Modified1:20:15 PM Thursday, February 23, 2012
Columns
NameData TypeMax Length (Bytes)Allow NullsDefault
Cluster Primary Key PK_OpportunityMain: OpportunityKeyForeign Keys FK_OpportunityMain_UniformRegistry: [dbo].[UniformRegistry].OpportunityKeyOpportunityKeyuniqueidentifier16
No
(newid())
Foreign Keys FK_OpportunityMain_OpportunityType: [dbo].[OpportunityType].OpportunityTypeKeyIndexes IX_OpportunityMain_OpportunityTypeKey: OpportunityTypeKeyOpportunityTypeKeyuniqueidentifier16
No
Idint4
No
((1))
Descriptionnvarchar(200)400
No
Indexes IX_OpportunityMain_OpportunityOwnerGroupKey: OpportunityOwnerGroupKeyOpportunityOwnerGroupKeyuniqueidentifier16
No
Indexes IX_OpportunityMain_OpportunityContactGroupKey: OpportunityContactGroupKeyOpportunityContactGroupKeyuniqueidentifier16
No
Foreign Keys FK_OpportunityMain_ContactMain: [dbo].[ContactMain].ProspectKeyIndexes IX_OpportunityMain_ProspectKey: ProspectKeyProspectKeyuniqueidentifier16
No
CurrentActionPlanStageNamenvarchar(200)400
Yes
('')
WinProbabilitydecimal(12,2)9
No
((0))
ActionManifestntextmax
Yes
Foreign Keys FK_OpportunityMain_OpportunityStatusRef: [dbo].[OpportunityStatusRef].OpportunityStatusCodeIndexes IX_OpportunityMain_OpportunityStatusCode: OpportunityStatusCodeOpportunityStatusCodeint4
No
SourceCodeKeyuniqueidentifier16
Yes
ExpirationDatedatetime8
Yes
Foreign Keys FK_OpportunityMain_UserMain_UpdatedBy: [dbo].[UserMain].UpdatedByUserKeyIndexes IX_OpportunityMain_UpdatedByUserKey: UpdatedByUserKeyUpdatedByUserKeyuniqueidentifier16
No
UpdatedOndatetime8
No
Foreign Keys FK_OpportunityMain_UserMain_CreatedBy: [dbo].[UserMain].CreatedByUserKeyIndexes IX_OpportunityMain_CreatedByUserKey: CreatedByUserKeyCreatedByUserKeyuniqueidentifier16
No
CreatedOndatetime8
No
SystemEntityKeyuniqueidentifier16
No
Foreign Keys FK_OpportunityMain_AccessMain: [dbo].[AccessMain].AccessKeyIndexes AK_OpportunityMain_AccessKey: AccessKeyAccessKeyuniqueidentifier16
No
MarkedForDeleteOndatetime8
Yes
Indexes IX_OpportunityMain_ProductKey: ProductKeyProductKeyuniqueidentifier16
Yes
Indexes Indexes
NameColumnsUnique
Cluster Primary Key PK_OpportunityMain: OpportunityKeyPK_OpportunityMainOpportunityKey
Yes
AK_OpportunityMain_AccessKeyAccessKey
IX_OpportunityMain_CreatedByUserKeyCreatedByUserKey
IX_OpportunityMain_OpportunityContactGroupKeyOpportunityContactGroupKey
IX_OpportunityMain_OpportunityOwnerGroupKeyOpportunityOwnerGroupKey
IX_OpportunityMain_OpportunityStatusCodeOpportunityStatusCode
IX_OpportunityMain_OpportunityTypeKeyOpportunityTypeKey
IX_OpportunityMain_ProductKeyProductKey
IX_OpportunityMain_ProspectKeyProspectKey
IX_OpportunityMain_UpdatedByUserKeyUpdatedByUserKey
Foreign Keys Foreign Keys
NameColumns
FK_OpportunityMain_AccessMainAccessKey->[dbo].[AccessMain].[AccessKey]
FK_OpportunityMain_ContactMainProspectKey->[dbo].[ContactMain].[ContactKey]
FK_OpportunityMain_OpportunityStatusRefOpportunityStatusCode->[dbo].[OpportunityStatusRef].[OpportunityStatusCode]
FK_OpportunityMain_OpportunityTypeOpportunityTypeKey->[dbo].[OpportunityType].[OpportunityTypeKey]
FK_OpportunityMain_UniformRegistryOpportunityKey->[dbo].[UniformRegistry].[UniformKey]
FK_OpportunityMain_UserMain_CreatedByCreatedByUserKey->[dbo].[UserMain].[UserKey]
FK_OpportunityMain_UserMain_UpdatedByUpdatedByUserKey->[dbo].[UserMain].[UserKey]
Permissions
TypeActionOwning Principal
GrantDeleteIMIS
GrantInsertIMIS
GrantReferencesIMIS
GrantSelectIMIS
GrantUpdateIMIS
SQL Script
CREATE TABLE [dbo].[OpportunityMain]
(
[OpportunityKey] [uniqueidentifier] NOT NULL CONSTRAINT [DF_OpportunityMain_OpportunityKey] DEFAULT (newid()),
[OpportunityTypeKey] [uniqueidentifier] NOT NULL,
[Id] [int] NOT NULL CONSTRAINT [DF_OpportunityMain_Id] DEFAULT ((1)),
[Description] [nvarchar] (200) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[OpportunityOwnerGroupKey] [uniqueidentifier] NOT NULL,
[OpportunityContactGroupKey] [uniqueidentifier] NOT NULL,
[ProspectKey] [uniqueidentifier] NOT NULL,
[CurrentActionPlanStageName] [nvarchar] (200) COLLATE SQL_Latin1_General_CP1_CI_AS NULL CONSTRAINT [DF_OpportunityMain_CurrentActionPlanStageName] DEFAULT (''),
[WinProbability] [decimal] (12, 2) NOT NULL CONSTRAINT [DF_OpportunityMain_WinProbability] DEFAULT ((0)),
[ActionManifest] [ntext] COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[OpportunityStatusCode] [int] NOT NULL,
[SourceCodeKey] [uniqueidentifier] NULL,
[ExpirationDate] [datetime] NULL,
[UpdatedByUserKey] [uniqueidentifier] NOT NULL,
[UpdatedOn] [datetime] NOT NULL,
[CreatedByUserKey] [uniqueidentifier] NOT NULL,
[CreatedOn] [datetime] NOT NULL,
[SystemEntityKey] [uniqueidentifier] NOT NULL,
[AccessKey] [uniqueidentifier] NOT NULL,
[MarkedForDeleteOn] [datetime] NULL,
[ProductKey] [uniqueidentifier] NULL
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]

GO
ALTER TABLE [dbo].[OpportunityMain] ADD CONSTRAINT [PK_OpportunityMain] PRIMARY KEY CLUSTERED ([OpportunityKey]) ON [PRIMARY]
GO
CREATE NONCLUSTERED INDEX [AK_OpportunityMain_AccessKey] ON [dbo].[OpportunityMain] ([AccessKey]) ON [PRIMARY]
GO
CREATE NONCLUSTERED INDEX [IX_OpportunityMain_CreatedByUserKey] ON [dbo].[OpportunityMain] ([CreatedByUserKey]) ON [PRIMARY]
GO
CREATE NONCLUSTERED INDEX [IX_OpportunityMain_OpportunityContactGroupKey] ON [dbo].[OpportunityMain] ([OpportunityContactGroupKey]) ON [PRIMARY]
GO
CREATE NONCLUSTERED INDEX [IX_OpportunityMain_OpportunityOwnerGroupKey] ON [dbo].[OpportunityMain] ([OpportunityOwnerGroupKey]) ON [PRIMARY]
GO
CREATE NONCLUSTERED INDEX [IX_OpportunityMain_OpportunityStatusCode] ON [dbo].[OpportunityMain] ([OpportunityStatusCode]) ON [PRIMARY]
GO
CREATE NONCLUSTERED INDEX [IX_OpportunityMain_OpportunityTypeKey] ON [dbo].[OpportunityMain] ([OpportunityTypeKey]) ON [PRIMARY]
GO
CREATE NONCLUSTERED INDEX [IX_OpportunityMain_ProductKey] ON [dbo].[OpportunityMain] ([ProductKey]) ON [PRIMARY]
GO
CREATE NONCLUSTERED INDEX [IX_OpportunityMain_ProspectKey] ON [dbo].[OpportunityMain] ([ProspectKey]) ON [PRIMARY]
GO
CREATE NONCLUSTERED INDEX [IX_OpportunityMain_UpdatedByUserKey] ON [dbo].[OpportunityMain] ([UpdatedByUserKey]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[OpportunityMain] ADD CONSTRAINT [FK_OpportunityMain_AccessMain] FOREIGN KEY ([AccessKey]) REFERENCES [dbo].[AccessMain] ([AccessKey])
GO
ALTER TABLE [dbo].[OpportunityMain] ADD CONSTRAINT [FK_OpportunityMain_ContactMain] FOREIGN KEY ([ProspectKey]) REFERENCES [dbo].[ContactMain] ([ContactKey])
GO
ALTER TABLE [dbo].[OpportunityMain] ADD CONSTRAINT [FK_OpportunityMain_OpportunityStatusRef] FOREIGN KEY ([OpportunityStatusCode]) REFERENCES [dbo].[OpportunityStatusRef] ([OpportunityStatusCode])
GO
ALTER TABLE [dbo].[OpportunityMain] ADD CONSTRAINT [FK_OpportunityMain_OpportunityType] FOREIGN KEY ([OpportunityTypeKey]) REFERENCES [dbo].[OpportunityType] ([OpportunityTypeKey])
GO
ALTER TABLE [dbo].[OpportunityMain] ADD CONSTRAINT [FK_OpportunityMain_UniformRegistry] FOREIGN KEY ([OpportunityKey]) REFERENCES [dbo].[UniformRegistry] ([UniformKey])
GO
ALTER TABLE [dbo].[OpportunityMain] ADD CONSTRAINT [FK_OpportunityMain_UserMain_CreatedBy] FOREIGN KEY ([CreatedByUserKey]) REFERENCES [dbo].[UserMain] ([UserKey])
GO
ALTER TABLE [dbo].[OpportunityMain] ADD CONSTRAINT [FK_OpportunityMain_UserMain_UpdatedBy] FOREIGN KEY ([UpdatedByUserKey]) REFERENCES [dbo].[UserMain] ([UserKey])
GO
GRANT REFERENCES ON  [dbo].[OpportunityMain] TO [IMIS]
GRANT SELECT ON  [dbo].[OpportunityMain] TO [IMIS]
GRANT INSERT ON  [dbo].[OpportunityMain] TO [IMIS]
GRANT DELETE ON  [dbo].[OpportunityMain] TO [IMIS]
GRANT UPDATE ON  [dbo].[OpportunityMain] TO [IMIS]
GO
Uses
Used By